<template>
  <view>
    <view class="cu-card case">
      <view class="cu-item shadow bg-white">
        <uni-segmented-control
          :current="current"
          :values="items.map(v=>v.title)"
          @clickItem="handleClick"
          style-type="text"
          active-color="#feb2b2"
        ></uni-segmented-control>
      </view>
    </view>

    <view class="home_content">
      <view v-if="current === 0">
        <login-record></login-record>
      </view>
      <view v-if="current === 1">
        <credit-record></credit-record>
      </view>
    </view>
  </view>
</template>

<script>
import { uniSegmentedControl } from "@dcloudio/uni-ui";
import loginRecord from "./login-record/index";
import creditRecord from "./credit-record/index";
export default {
  components: {
    uniSegmentedControl,
    loginRecord,
    creditRecord
  },
  data() {
    return {
      current: 1,
      items: [{ title: "登录记录" }, { title: "积分记录" }]
    };
  },

  onLoad() {},
  methods: {
    handleClick(e) {
      if (this.current != e.currentIndex) {
        this.current = e.currentIndex;
      }
    }
  }
};
</script>

<style >
</style>